import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";

import Layout from "@/views/layout/index.vue";
import component from "element-plus/es/components/tree-select/src/tree-select-option.mjs";
import { KeepAlive } from "vue";

export const routes = [
  {
    path: "/cesium",
    component: Layout,
    reirect: "/cesium/demo",
    meta: {
      title: "Cesium",
    },
    children: [
      {
        path: "demo",
        meta: {
          title: "demo",
          KeepAlive: true,
        },
        component: () => import("@/views/cesium/index.vue"),
      },
      {
        path: "ag_demo",
        meta: {
          title: "ag_demo",
          KeepAlive: true,
        },
        component: () => import("@/views/agcim/index.vue"),
      },
      {
        path: "custom_table",
        meta: {
          title: "custom_table",
          KeepAlive: true,
        },
        component: () => import("@/views/custom_table/index.vue"),
      },
    ],
  },
  {
    path: "/echarts",
    component: Layout,
    meta: {
      title: "echarts",
    },
    children: [
      {
        path: "fiveChart",
        name: "五色图",
        meta: {
          title: "五色图",
        },
        component: () => import("../views/fiveChart/index.vue"),
      },
      {
        path: "fiveChartInline",
        name: "五色图line",
        meta: {
          title: "五色图line",
        },
        component: () => import("../views/fiveChart/line/index.vue"),
      },
      {
        path: "fiveChart3d",
        name: "五色图",
        meta: {
          title: "五色图3d",
        },
        component: () => import("../views/fiveChart/3d/index.vue"),
      },
      {
        path: "fiveChart3d-gl",
        name: "五色图gl",
        meta: {
          title: "五色图3dgl",
        },
        component: () => import("../views/fiveChart/3d-gl/index3d.vue"),
      },

      {
        path: "signature",
        name: "签名",
        meta: {
          title: "签名",
        },
        component: () => import("../views/signature/index.vue"),
      },
    ],
  },
];
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      redirect: "/cesium/custom_table",
    },
    ...routes,
  ],
});

export default router;
